
import React from 'react';

import Home from '@/pages/Home.js';
import Gamble from '@/pages/Gamble.js';
import Login from '@/pages/Login.js';
import Registry from '@/pages/Registry.js';
import Post from '@/pages/Post.js';
import My from '@/pages/My.js';
import ResetPassword from '@/pages/ResetPassword.js';
import Contribution from '@/pages/Contribution.js';
import MenuBottom from '@/comps/MenuBottom.js';


const maps = { Home, Gamble, My, Post, Login, Registry,ResetPassword,Contribution }
export default function (props) {
  let C = maps[props.comp]
  let bLogined = true
  document.title = '26号宇宙'
  if (props.doctitle) {
    document.title = props.doctitle
  }
  if (!bLogined) {//没登录的路由
    console.log('bLogined为false的状态')
    return (
      <Login {...ev} />
    )
  }
  return (//已登录的路由
    <div>
      <C {...props} />
      {props.mainpage ? <MenuBottom /> : null}
    </div>
  )
}